package com.gsafety.wellsfort.controller.security;

import com.gsafety.wellsfort.common.util.ApiResponse;
import com.gsafety.wellsfort.domain.dto.secuirty.OpCodeDTO;
import com.gsafety.wellsfort.service.security.IRoleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 操作权限 controller
 *
 * @author tangjiawei
 * @date 2020/04/28
 */
@Api(description = "操作权限接口")
@RestController
@Slf4j
@RequestMapping("/api/auOperation")
public class AuOperationController {

    @Autowired
    private IRoleService roleService;

    /**
     * 判断权限
     *
     * @return
     */
    @ApiOperation(value = "判断权限")
    @PostMapping("/checkPermission")
    public ApiResponse checkPermission(@RequestBody OpCodeDTO opCodeDto) {
        return roleService.checkPermission(opCodeDto.getOpCode());
    }
}
